// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取图纸列表 GET /api/drawing */
export async function queryDrawing(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/drawing', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 更新图纸 PUT /api/drawing */
export async function updateDrawing(body: API.DrawingItem, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/drawing', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 添加图纸 POST /api/drawing */
export async function addDrawing(body: API.DrawingItem, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/drawing', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除图纸 DELETE /api/drawing */
export async function removeDrawing(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/drawing', {
    method: 'DELETE',
    ...(options || {}),
  });
}



/** 批量更新设备 POST /api/device */
export async function batchUpdateDrawing(body: object, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/drawing/batchupdate', {
    method: 'POST',
    requestType:'form',
    data: body,
    ...(options || {}),
  });
}
